<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('','StaticPagesController@home')->name('home');
Route::get('signup','UsersController@create')->name('signup');
Route::resource('users','UsersController');
Route::get('login','SessionsController@create')->name('login');
Route::post('login','SessionsController@store')->name('login');
Route::delete('logout','SessionsController@destroy')->name('logout');
Route::get('signup/confirm/{token}','UsersController@confirm')->name('confirm');
//重置密码四部曲
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
Route::resource('blogs','BlogsController',['only' => ['store','destroy']]);
Route::get('users/{user}/followings','FollowersController@followings')->name('followings');
Route::get('users/{user}/followers','FollowersController@followers')->name('followers');
Route::post('users/{user}/follow','FollowersController@follow')->name('follow');
Route::delete('users/{user}/unfollow',"FollowersController@unfollow")->name('unfollow');